import base64 as b64
import json

import requests

signUrl = ''

signatoriesList = [{'x': 100,
                    'y': 160,
                    'page': 1,
                    'sealId': 53011100018363
                    }]
param = {'outUserId':'d0ae8e26efff410a8c53d5040a006e42','timestamp':'123','siteId':'10000','title':'123'}
param['signatoriesList']=signatoriesList


with open("D:\\Desktop\\新建文件夹\\1.2.156.3005.2.11100000000013223N001.11530000015100426Q.15ECD21D69B94BB795B4515D674BADB0.001.9-0.ofd",'rb') as ofd:
    file = b64.b64encode(ofd.read()).decode('ASCII')
    param['file'] = file

response = requests.post(signUrl, json=param)


j = response.json()
layoutPath = j.get('data')[0].get('layoutPath')
downLoadUrl = ""+layoutPath


with open("D:\\Desktop\\盖章\\3.ofd",'wb') as ofd:
    response = requests.get(downLoadUrl)
    ofd.write(response.content)










